package com.mvc.framework.scheduling;

import java.io.InputStream;
import java.io.Serializable;

import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

public class ExtendSchedulerFactoryBean extends SchedulerFactoryBean implements Serializable{

	private static final long serialVersionUID = -1160717800136961172L;

	public ExtendSchedulerFactoryBean() {
		super();
		/**
		 * The cluster properties file
		 */
		InputStream in = getClass().getClassLoader().getResourceAsStream("quartz_cluster.properties");
		if(in!=null){
			Resource resource = new InputStreamResource(in);
			setConfigLocation(resource);
		}else{
			logger.warn("Not found the quartz.properties");
		}
		setOverwriteExistingJobs(true);
	}
}